﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// abstract ChietKhauNhanh typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ChietKhauNhanhDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ChietKhauNhanhDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ChietKhauNhanh _currentChietKhauNhanh = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxChietKhauNhanhDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxChietKhauNhanhErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxChietKhauNhanhBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ChietKhauNhanhId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxChietKhauNhanhIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MucThuong property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxMucThuongDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the ChietKhauId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxChietKhauIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the LastUpdate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxLastUpdateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the UpdateBy property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxUpdateByDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the NhomSanPhamId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxNhomSanPhamIdDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.NhomSanPham> _NhomSanPhamIdList;
		
		/// <summary> 
		/// The list of selectable NhomSanPham
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.NhomSanPham> NhomSanPhamIdList
		{
			get {return this._NhomSanPhamIdList;}
			set 
			{
				this._NhomSanPhamIdList = value;
				this.uxNhomSanPhamIdDataGridViewColumn.DataSource = null;
				this.uxNhomSanPhamIdDataGridViewColumn.DataSource = this._NhomSanPhamIdList;
			}
		}
		
		private bool _allowNewItemInNhomSanPhamIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of NhomSanPham
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInNhomSanPhamIdList
		{
			get { return _allowNewItemInNhomSanPhamIdList;}
			set
			{
				this._allowNewItemInNhomSanPhamIdList = value;
				this.uxNhomSanPhamIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.ChietKhau> _ChietKhauIdList;
		
		/// <summary> 
		/// The list of selectable ChietKhau
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ChietKhau> ChietKhauIdList
		{
			get {return this._ChietKhauIdList;}
			set 
			{
				this._ChietKhauIdList = value;
				this.uxChietKhauIdDataGridViewColumn.DataSource = null;
				this.uxChietKhauIdDataGridViewColumn.DataSource = this._ChietKhauIdList;
			}
		}
		
		private bool _allowNewItemInChietKhauIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ChietKhau
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInChietKhauIdList
		{
			get { return _allowNewItemInChietKhauIdList;}
			set
			{
				this._allowNewItemInChietKhauIdList = value;
				this.uxChietKhauIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ChietKhauNhanh> _ChietKhauNhanhList;
				
		/// <summary> 
		/// The list of ChietKhauNhanh to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ChietKhauNhanh> ChietKhauNhanhList
		{
			get {return this._ChietKhauNhanhList;}
			set
			{
				this._ChietKhauNhanhList = value;
				this.uxChietKhauNhanhBindingSource.DataSource = null;
				this.uxChietKhauNhanhBindingSource.DataSource = value;
				this.uxChietKhauNhanhDataGridView.DataSource = null;
				this.uxChietKhauNhanhDataGridView.DataSource = this.uxChietKhauNhanhBindingSource;				
				//this.uxChietKhauNhanhBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxChietKhauNhanhBindingSource_ListChanged);
				this.uxChietKhauNhanhBindingSource.CurrentItemChanged += new System.EventHandler(OnChietKhauNhanhBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnChietKhauNhanhBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentChietKhauNhanh = uxChietKhauNhanhBindingSource.Current as Entities.ChietKhauNhanh;
			
			if (_currentChietKhauNhanh != null)
			{
				_currentChietKhauNhanh.Validate();
			}
			//_ChietKhauNhanh.Validate();
			OnCurrentEntityChanged();
		}

		//void uxChietKhauNhanhBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ChietKhauNhanh"/> instance.
		/// </summary>
		public Entities.ChietKhauNhanh SelectedChietKhauNhanh
		{
			get {return this._currentChietKhauNhanh;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxChietKhauNhanhDataGridView.VirtualMode;}
			set
			{
				this.uxChietKhauNhanhDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxChietKhauNhanhDataGridView.AllowUserToAddRows;}
			set {this.uxChietKhauNhanhDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxChietKhauNhanhDataGridView.AllowUserToDeleteRows;}
			set {this.uxChietKhauNhanhDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxChietKhauNhanhDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxChietKhauNhanhDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ChietKhauNhanhDataGridViewBase"/> class.
		/// </summary>
		public ChietKhauNhanhDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxChietKhauNhanhDataGridView = new System.Windows.Forms.DataGridView();
			this.uxChietKhauNhanhBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxChietKhauNhanhErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxChietKhauNhanhIdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxMucThuongDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxChietKhauIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxLastUpdateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxUpdateByDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNhomSanPhamIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			//this.uxNhomSanPhamIdBindingSource = new NhomSanPhamBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxNhomSanPhamIdBindingSource)).BeginInit();
			//this.uxChietKhauIdBindingSource = new ChietKhauBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxChietKhauIdBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxChietKhauNhanhErrorProvider
			// 
			this.uxChietKhauNhanhErrorProvider.ContainerControl = this;
			this.uxChietKhauNhanhErrorProvider.DataSource = this.uxChietKhauNhanhBindingSource;						
			// 
			// uxChietKhauNhanhDataGridView
			// 
			this.uxChietKhauNhanhDataGridView.AutoGenerateColumns = false;
			this.uxChietKhauNhanhDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxChietKhauNhanhDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxChietKhauNhanhIdDataGridViewColumn,
		this.uxMucThuongDataGridViewColumn,
		this.uxChietKhauIdDataGridViewColumn,
		this.uxLastUpdateDataGridViewColumn,
		this.uxUpdateByDataGridViewColumn,
		this.uxNhomSanPhamIdDataGridViewColumn			});
			this.uxChietKhauNhanhDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxChietKhauNhanhDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxChietKhauNhanhDataGridView.Name = "uxChietKhauNhanhDataGridView";
			this.uxChietKhauNhanhDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxChietKhauNhanhDataGridView.TabIndex = 0;	
			this.uxChietKhauNhanhDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxChietKhauNhanhDataGridView.EnableHeadersVisualStyles = false;
			this.uxChietKhauNhanhDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnChietKhauNhanhDataGridViewDataError);
			this.uxChietKhauNhanhDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChietKhauNhanhDataGridViewCellValueNeeded);
			this.uxChietKhauNhanhDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChietKhauNhanhDataGridViewCellValuePushed);
			
			//
			// uxChietKhauNhanhIdDataGridViewColumn
			//
			this.uxChietKhauNhanhIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChietKhauNhanhIdDataGridViewColumn.DataPropertyName = "ChietKhauNhanhId";
			this.uxChietKhauNhanhIdDataGridViewColumn.HeaderText = "ChietKhauNhanhId";
			this.uxChietKhauNhanhIdDataGridViewColumn.Name = "uxChietKhauNhanhIdDataGridViewColumn";
			this.uxChietKhauNhanhIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChietKhauNhanhIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChietKhauNhanhIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxMucThuongDataGridViewColumn
			//
			this.uxMucThuongDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMucThuongDataGridViewColumn.DataPropertyName = "MucThuong";
			this.uxMucThuongDataGridViewColumn.HeaderText = "MucThuong";
			this.uxMucThuongDataGridViewColumn.Name = "uxMucThuongDataGridViewColumn";
			this.uxMucThuongDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMucThuongDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMucThuongDataGridViewColumn.ReadOnly = false;		
			//
			// uxChietKhauIdDataGridViewColumn
			//
			this.uxChietKhauIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChietKhauIdDataGridViewColumn.DataPropertyName = "ChietKhauId";
			this.uxChietKhauIdDataGridViewColumn.HeaderText = "ChietKhauId";
			this.uxChietKhauIdDataGridViewColumn.Name = "uxChietKhauIdDataGridViewColumn";
			this.uxChietKhauIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChietKhauIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChietKhauIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxLastUpdateDataGridViewColumn
			//
			this.uxLastUpdateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLastUpdateDataGridViewColumn.DataPropertyName = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.HeaderText = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.Name = "uxLastUpdateDataGridViewColumn";
			this.uxLastUpdateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLastUpdateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLastUpdateDataGridViewColumn.ReadOnly = false;		
			//
			// uxUpdateByDataGridViewColumn
			//
			this.uxUpdateByDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxUpdateByDataGridViewColumn.DataPropertyName = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.HeaderText = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.Name = "uxUpdateByDataGridViewColumn";
			this.uxUpdateByDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxUpdateByDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxUpdateByDataGridViewColumn.ReadOnly = false;		
			//
			// uxNhomSanPhamIdDataGridViewColumn
			//
			this.uxNhomSanPhamIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNhomSanPhamIdDataGridViewColumn.DataPropertyName = "NhomSanPhamId";
			this.uxNhomSanPhamIdDataGridViewColumn.HeaderText = "NhomSanPhamId";
			this.uxNhomSanPhamIdDataGridViewColumn.Name = "uxNhomSanPhamIdDataGridViewColumn";
			this.uxNhomSanPhamIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNhomSanPhamIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNhomSanPhamIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxNhomSanPhamIdDataGridViewColumn
			//				
			this.uxNhomSanPhamIdDataGridViewColumn.DisplayMember = "SanPhamId";	
			this.uxNhomSanPhamIdDataGridViewColumn.ValueMember = "NhomSanPhamId";	
			this.uxNhomSanPhamIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxNhomSanPhamIdDataGridViewColumn.DataSource = uxNhomSanPhamIdBindingSource;				
				
			//
			// uxChietKhauIdDataGridViewColumn
			//				
			this.uxChietKhauIdDataGridViewColumn.DisplayMember = "StartDate";	
			this.uxChietKhauIdDataGridViewColumn.ValueMember = "ChietKhauId";	
			this.uxChietKhauIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxChietKhauIdDataGridViewColumn.DataSource = uxChietKhauIdBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxChietKhauNhanhDataGridView);
			this.Name = "ChietKhauNhanhDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxNhomSanPhamIdBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxChietKhauIdBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauNhanhBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ChietKhauNhanhDataGridViewEventArgs args = new ChietKhauNhanhDataGridViewEventArgs();
				args.ChietKhauNhanh = _currentChietKhauNhanh;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ChietKhauNhanhDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ChietKhauNhanh	_ChietKhauNhanh;
	
			/// <summary>
			/// the  Entities.ChietKhauNhanh instance.
			/// </summary>
			public Entities.ChietKhauNhanh ChietKhauNhanh
			{
				get { return _ChietKhauNhanh; }
				set { _ChietKhauNhanh = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxChietKhauNhanhDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauNhanhDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxChietKhauNhanhDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauNhanhDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChietKhauNhanhDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChietKhauNhanhIdDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].ChietKhauNhanhId;
						break;
					case "uxMucThuongDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].MucThuong;
						break;
					case "uxChietKhauIdDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].ChietKhauId;
						break;
					case "uxLastUpdateDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].LastUpdate;
						break;
					case "uxUpdateByDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].UpdateBy;
						break;
					case "uxNhomSanPhamIdDataGridViewColumn":
						e.Value = ChietKhauNhanhList[e.RowIndex].NhomSanPhamId;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxChietKhauNhanhDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauNhanhDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChietKhauNhanhDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChietKhauNhanhIdDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].ChietKhauNhanhId = (System.Guid)e.Value;
						break;
					case "uxMucThuongDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].MucThuong = (System.Byte)e.Value;
						break;
					case "uxChietKhauIdDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].ChietKhauId = (System.Guid)e.Value;
						break;
					case "uxLastUpdateDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].LastUpdate = (System.DateTime)e.Value;
						break;
					case "uxUpdateByDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].UpdateBy = (System.Int32)e.Value;
						break;
					case "uxNhomSanPhamIdDataGridViewColumn":
						ChietKhauNhanhList[e.RowIndex].NhomSanPhamId = (System.Guid)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
